<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html >
<head>
	<meta name="decorator" content="sysDefault" content="text/html; charset=utf-8"/>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#code").focus();
			$("#regionForm").validate({
				submitHandler: function(form){
					Oosp_Loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
		
		//表单提交
		function formSubmit()
		{
			var path = $('#excelFile').val();
			var point_index=path.indexOf(".");
			var extName = path.substring(point_index+1, path.length);
			if(extName!='xls'){
				top.$.jBox.tip('请选择 格式为*.xls文件进行导入!','warning');
			}else{
				$("#save").attr("disabled","disabled");
				Oosp_Loading('正在导入，请稍等...');
				document.importForm.submit();
			}
		}
		$(function() {
			$("#save").removeAttr("disabled");
		});
	</script>
</head>
<body>
	<div class="container-fluid">
		<div class="row">
			<div class="col-xs-12">
				<div class="panel panel-default">
				  <div class="panel-heading">
				    <h3 class="panel-title">批量导入
						<a class="btn btn-default btn-sm pull-right" role="button" href="javascript:void(0)" onclick="history.go(-1)">返回</a>
				    </h3>
				  </div>
				  <div class="panel-body">
					<form:form id="contractAttForm" modelAttribute="attType" action="${contextPath}/sys/base/contractAtt/${typeid}/importAttType" method="post" enctype="multipart/form-data" class="form-horizontal" role="form">
						<tags:message content="${message}" />
						<div class="form-group">
							<div class="col-sm-10 col-lb-2 f_6">
								<input type="file" size="40" name="excelFile" id="excelFile"/>
							</div>
						</div>
						<div class="form-group">
						  <div class="col-sm-offset-2 col-sm-10">
						    <input id="save" class="btn btn-primary" type="submit" value="保 存"/>
							<input class="btn btn-default" type="button" value="关 闭" onclick="window.close()"/>
						  </div>
						</div>
					</form:form>
				  </div>
				</div>			
			</div>
		</div>
	</div>
</body>
</html>